// 对象
// 用法
// let 对象名:{属性名:属性的类型,...}={属性名:值...}
// 对象的可选属性  ?:意思：可以有也可以没有
// 对象经常结合类型别名使用
// type Tobj={username:string;age:number}
type Tobj = {
  username: string
  age?: number
  arr: number[]
  fn: (a: number, b?: number) => number
}
let obj: Tobj = {
  username: '张三',
  //   age: 18,
  arr: [1, 2, 3],
  fn (a, b) {
    return a
  }
}

obj.age = 18

let query: {
  username?: string
  email?: string
  role_id?: string
  page?: number
  limit?: number
} = {
  username: '张三'
}

let query2: {
  receiver: string
  mobile: string
  provinceCode: string
  cityCode: string
  countyCode: string
  addressDetail: string
  isDefault: number
} = {
  receiver: '测试',
  mobile: 'string',
  provinceCode: 'string',
  cityCode: 'string',
  countyCode: 'string',
  addressDetail: 'string',
  isDefault: 0
}

export {}
